package com.gary.shiro.controller;

import com.gary.shiro.MyRedisProperties;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author peng_rui
 * @date 2022/3/26
 */
@RestController
@RequiresPermissions(value = {"user:system:abc"})
public class UserController {

    @Resource
    private MyRedisProperties myRedisProperties;

    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public String hello() {
        System.out.println("hello");
        return "hello";
    }

    @RequestMapping(value = "test", method = RequestMethod.GET)
    public String test() {
        System.out.println("test");
        return "test";
    }

    @RequestMapping(value = "/my-properties", method = RequestMethod.GET)
    public String myProperties() {
        myRedisProperties.showProperties();
        return "myProperties";
    }
}
